
#install.packages('DBI')

#加载各类包
source('commons.R')

linkdata = function(tableName){
  
  library(DBI)
  library(RMySQL)
  library(ROCR)
  
  con <- dbConnect(MySQL(), host=MYSQL_HOST, dbname=MYSQL_DB, user=MYSQL_USER, password=MYSQL_PWD)
  res <- dbSendQuery(con, paste("SELECT * FROM ",tableName)) 
  data <- dbFetch(res, n=-1) 
  dbDisconnect(con)
  return(data)
}

# datax=linkdata(tableName)  
# columnY = 'leng'
# datax[,columnY]

